#!/usr/bin/env python
#-*- coding:utf-8 -*-
# author:Administrator
# datetime:2019/11/25 10:50
# software: PyCharm
# Email:zhou.haitao@technosolutions.cn
__auther__ = "Kael"


import os

file_raw_path ="2018年4-9月VOC离线数据"

file_target_within="./data_within"
file_target_without="./data_without"



def copy_file(raw_file_path,target_file_path):
    f = open(target_file_path,"wb")
    f.write(open(raw_file_path,'rb').read())
    f.close()


def process_file(file_name):
    for file in os.listdir(file_name):
        file_path = os.path.join(file_name,file)

        if  os.path.isfile(file_path):
            if "除" in file_path:
                copy_file(file_path,'./data_without/'+file)
            else:
                copy_file(file_path, './data_within/' + file)
        else:
            process_file(file_path)


if __name__ == '__main__':
    process_file(file_raw_path)